package com.summer.peony.system.mapper;

import java.util.List;

import org.apache.ibatis.annotations.Mapper;
import org.apache.ibatis.annotations.Param;

import com.summer.peony.system.pojo.SysUserRoleExample;
import com.summer.peony.system.pojo.SysUserRoleKey;

@Mapper
public interface SysUserRoleMapper {
	long countByExample(SysUserRoleExample example);

	int deleteByExample(SysUserRoleExample example);

	int deleteByPrimaryKey(SysUserRoleKey key);

	int insert(SysUserRoleKey record);

	int insertSelective(SysUserRoleKey record);

	List<SysUserRoleKey> selectByExample(SysUserRoleExample example);

	int updateByExampleSelective(@Param("record") SysUserRoleKey record, @Param("example") SysUserRoleExample example);

	int updateByExample(@Param("record") SysUserRoleKey record, @Param("example") SysUserRoleExample example);

	/**
	 * 批量新增用户角色信息
	 * 
	 * @param userRoleList 用户角色列表
	 * @return 结果
	 */
	public int batchUserRole(List<SysUserRoleKey> userRoleList);

	/**
	 * 通过角色ID删除用户和角色关联
	 * 
	 * @param userId 用户ID
	 * @return 结果
	 */
	public int deleteUserRoleByUserId(Integer userId);

	/**
	 * @Description: TODO(通过用户ID查询出所有角色)
	 * @param userId
	 * @return Integer[]
	 * @author: TaoGe
	 * @date: 2021年1月28日 上午10:48:13
	 * @throws:
	 */
	public Integer[] getAllRoleIds(Integer userId);
}